package com.woniu.woniuk16.controller;


import com.woniu.woniuk16.dto.ClassDto;
import com.woniu.woniuk16.exception.stu.StudentException;
import com.woniu.woniuk16.model.Result;
import com.woniu.woniuk16.service.WoniuClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tiangle
 * @since 2021-12-16
 */
@RestController
@RequestMapping("/woniuClass")
public class WoniuClassController {

    @Autowired
    private WoniuClassService woniuClassService;
    @GetMapping("/classes")
    public Result getClasses() throws StudentException {
        List<ClassDto> classes = woniuClassService.getClasses();
        return Result.getInstance(classes);
    }

}

